persons = [{'name': 'A', 'age': 23, 'score': 98},
           {'name': 'B', 'age': 13, 'score': 56},
           {'name': 'C', 'age': 34, 'score': 67},
           {'name': 'D', 'age': 16, 'score': 86},
           {'name': 'E', 'age': 99, 'score': 64},
           {'name': 'F', 'age': 25, 'score': 89}]


def compare_age(dict_person):
    return dict_person['age']


persons.sort(key=compare_age)
print(persons)
# 使用lambda
persons.sort(key=lambda person: person['score'])
print(persons)

